﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MobileCarManager.MobileControls.Styles;

namespace MobileCarManager.MobileControls.AppStylist.Stylists.View
{
  public partial class ViewStylist : UserControl
  {
    public ViewStylist()
    {
      InitializeComponent();

      pictureBoxBackcolor1.BackColor = StyleManager.Instance.Styles.View.BackgroundGradient.Gradient[0];
      pictureBoxBackcolor2.BackColor = StyleManager.Instance.Styles.View.BackgroundGradient.Gradient[1];
    }

    private void OnBackcolor1Click(object sender, EventArgs e)
    {
      ColorDialog colorDialog = new ColorDialog();
      colorDialog.Color = pictureBoxBackcolor1.BackColor;
      if (DialogResult.OK == colorDialog.ShowDialog())
      {
        pictureBoxBackcolor1.BackColor = colorDialog.Color;
        StyleManager.Instance.Styles.View.BackgroundGradient.Gradient[0] = colorDialog.Color;
        view1.Invalidate();
      }
    }

    private void OnBackcolor2Click(object sender, EventArgs e)
    {
      ColorDialog colorDialog = new ColorDialog();
      colorDialog.Color = pictureBoxBackcolor2.BackColor;
      if (DialogResult.OK == colorDialog.ShowDialog())
      {
        pictureBoxBackcolor2.BackColor = colorDialog.Color;
        StyleManager.Instance.Styles.View.BackgroundGradient.Gradient[1] = colorDialog.Color;
        view1.Invalidate();
      }
    }
  }
}
